import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { TabsPage } from './tabs.page';

const routes: Routes = [
  {
    path: 'tabs',
    component: TabsPage,
    children: [
      {
        path: 'chats',
        loadChildren: () => import('../chats/chats.module').then( m => m.ChatsPageModule)
      },
      {
        path: 'address-book',
        loadChildren: () => import('../address-book/address-book.module').then( m => m.AddressBookPageModule)
      },
      {
        path: 'discovery',
        loadChildren: () => import('../discovery/discovery.module').then( m => m.DiscoveryPageModule)
      },
      {
        path: 'me',
        loadChildren: () => import('../me/me.module').then( m => m.MePageModule)
      },
      {
        path: '',
        redirectTo: '/tabs/chats',
        pathMatch: 'full'
      }
    ]
  },
  {
    path: '',
    redirectTo: '/tabs/chats',
    pathMatch: 'full'
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
})
export class TabsPageRoutingModule {}
